package manage.util.excel;


public class SheetCell {
	private Object content;
	private String format;//格式   content为数字或日期时有效
	private String align;
	private Integer width;
//	private String color;//文字颜色
//	private String background;//背景颜色
	private boolean head=false;//头部单元格，特殊背景颜色
	private boolean borderTop=false;
	private boolean borderBottom=false;
	private boolean borderLeft=false;
	private boolean borderRight=false;
	
	public SheetCell(Object content,Integer width){
		this(content,width,"left");
	}
	public SheetCell(Object content,String format,Integer width){
		this(content,format,width,"left");
	}
	public SheetCell(Object content,Integer width,String align){
		this(content,"",width,align);
	}
	public SheetCell(Object content,String format,Integer width,String align){
		this.content=content;
		this.format=format;
		this.width=width;
		this.align=align;
//		this.color="#000000";
//		this.background="#ffffff";
	}
	
	/**
	 * 
	 *  content
	 *  width
	 *  align
	 * 
	 */
	public static SheetCell headCell(String content,int width,String align){
		SheetCell cell=new SheetCell(content,width,align);
//		cell.setBackground("#aaaaaa");
		cell.setHead(true);
		cell.setBorder(true,true,true,true);
		return cell;
	}
	public SheetCell setBorder(boolean top,boolean right,boolean bottom,boolean left){
		this.borderTop=top;
		this.borderBottom=bottom;
		this.borderLeft=left;
		this.borderRight=right;
		return this;
	}
	public String getAlign() {
		return align;
	}
	public SheetCell setAlign(String align) {
		this.align = align;
		return this;
	}
	public Object getContent() {
		return content;
	}
	public SheetCell setContent(Object content) {
		this.content = content;
		return this;
	}
	public String getFormat() {
		return format;
	}
	public SheetCell setFormat(String format) {
		this.format = format;
		return this;
	}
	public Integer getWidth() {
		return width;
	}
	public SheetCell setWidth(Integer width) {
		this.width = width;
		return this;
	}
//	public String getColor() {
//		return color;
//	}
//	public SheetCell setColor(String color) {
//		this.color = color;
//		return this;
//	}
//	public String getBackground() {
//		return background;
//	}
//	public SheetCell setBackground(String background) {
//		this.background = background;
//		return this;
//	}

	public boolean isBorderTop() {
		return borderTop;
	}

	public SheetCell setBorderTop(boolean borderTop) {
		this.borderTop = borderTop;
		return this;
	}

	public boolean isBorderBottom() {
		return borderBottom;
	}

	public SheetCell setBorderBottom(boolean borderBottom) {
		this.borderBottom = borderBottom;
		return this;
	}

	public boolean isBorderLeft() {
		return borderLeft;
	}

	public SheetCell setBorderLeft(boolean borderLeft) {
		this.borderLeft = borderLeft;
		return this;
	}

	public boolean isBorderRight() {
		return borderRight;
	}

	public SheetCell setBorderRight(boolean borderRight) {
		this.borderRight = borderRight;
		return this;
	}

	public boolean isHead() {
		return head;
	}

	public SheetCell setHead(boolean head) {
		this.head = head;
		return this;
	}
}
